/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbviatmont")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbviatmont.findAll", query = "SELECT p FROM Pyfntbviatmont p"),
    @NamedQuery(name = "Pyfntbviatmont.findByPyfntbviatmontid", query = "SELECT p FROM Pyfntbviatmont p WHERE p.pyfntbviatmontid = :pyfntbviatmontid"),
    @NamedQuery(name = "Pyfntbviatmont.findByValormes", query = "SELECT p FROM Pyfntbviatmont p WHERE p.valormes = :valormes"),
    @NamedQuery(name = "Pyfntbviatmont.findByFecharegistro", query = "SELECT p FROM Pyfntbviatmont p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyfntbviatmont.findByObservaciones", query = "SELECT p FROM Pyfntbviatmont p WHERE p.observaciones = :observaciones")})
public class Pyfntbviatmont implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbviatmontid")
    private Integer pyfntbviatmontid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valormes")
    private double valormes;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "pyfntbreqviaticoid", referencedColumnName = "pyfntbreqviaticoid")
    @ManyToOne(optional = false)
    private Pyfntbreqviatico pyfntbreqviaticoid;
    @JoinColumn(name = "pyfntbmesesid", referencedColumnName = "pyfntbmesesid")
    @ManyToOne(optional = false)
    private Pyfntbmeses pyfntbmesesid;

    public Pyfntbviatmont() {
    }

    public Pyfntbviatmont(Integer pyfntbviatmontid) {
        this.pyfntbviatmontid = pyfntbviatmontid;
    }

    public Pyfntbviatmont(Integer pyfntbviatmontid, double valormes, Date fecharegistro) {
        this.pyfntbviatmontid = pyfntbviatmontid;
        this.valormes = valormes;
        this.fecharegistro = fecharegistro;
    }

    public Integer getPyfntbviatmontid() {
        return pyfntbviatmontid;
    }

    public void setPyfntbviatmontid(Integer pyfntbviatmontid) {
        this.pyfntbviatmontid = pyfntbviatmontid;
    }

    public double getValormes() {
        return valormes;
    }

    public void setValormes(double valormes) {
        this.valormes = valormes;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Pyfntbreqviatico getPyfntbreqviaticoid() {
        return pyfntbreqviaticoid;
    }

    public void setPyfntbreqviaticoid(Pyfntbreqviatico pyfntbreqviaticoid) {
        this.pyfntbreqviaticoid = pyfntbreqviaticoid;
    }

    public Pyfntbmeses getPyfntbmesesid() {
        return pyfntbmesesid;
    }

    public void setPyfntbmesesid(Pyfntbmeses pyfntbmesesid) {
        this.pyfntbmesesid = pyfntbmesesid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbviatmontid != null ? pyfntbviatmontid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbviatmont)) {
            return false;
        }
        Pyfntbviatmont other = (Pyfntbviatmont) object;
        if ((this.pyfntbviatmontid == null && other.pyfntbviatmontid != null) || (this.pyfntbviatmontid != null && !this.pyfntbviatmontid.equals(other.pyfntbviatmontid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbviatmont[ pyfntbviatmontid=" + pyfntbviatmontid + " ]";
    }
    
}
